<%@taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<meta http-equiv="Expires" CONTENT="-1"></meta>
<meta http-equiv="cache-control" content="no-cache"></meta>
<meta http-equiv="Pragma" CONTENT="no-cache"></meta>
<link rel="stylesheet" type="text/css" href="style/theme.css" />
<script type="text/javascript" src="js/dataloader.js"></script>
<script type="text/javascript" src="placesUtil.js"></script>
 <script type="text/javascript" src="http://apis.google.com/js/plusone.js"></script>
   <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js" type="text/javascript"></script>
</head>

<script type="text/javascript">
window.fbAsyncInit = function() {
    FB.init({
      appId      : '236178669829324',
      status     : true, 
      cookie     : true,
      xfbml      : true,
      oauth      : true,
    });
  };
  (function(d){
     var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
     js = d.createElement('script'); js.id = id; js.async = true;
     js.src = "//connect.facebook.net/en_US/all.js";
     d.getElementsByTagName('head')[0].appendChild(js);
   }(document));
 
</script>

<body>
 <!-- FACEBOOK comments sdk starts -->
	
<form>

	<section id="navigation"> <nav>
	
	</nav> </section>

	<section id="ct">
	<div >
		<IFRAME id="dataloader" src="initDataLoader" scrolling="auto" width="100%"
			height="100%"></IFRAME>
	</div>
	</section>
	<section >
	<div id="innerCt">
		<div><script charset="utf-8"
						src="http://widgets.twimg.com/j/2/widget.js"></script> <script>
							new TWTR.Widget({
								version : 2,
								type : 'search',
								search : 'Bangalore Tourist Places',
								interval : 30000,
								title : 'Bangalore Tourist Places',
								subject : 'Bangalore Tourism Tweets',
								width : 250,
								height : 300,
								theme : {
									shell : {
										background : '#8ec1da',
										color : '#ffffff'
									},
									tweets : {
										background : '#ffffff',
										color : '#444444',
										links : '#1985b5'
									}
								},
								features : {
									scrollbar : false,
									loop : true,
									live : true,
									behavior : 'default'
								}
							}).render().start();
						</script>
			</div>
			<div id="directionsPanel"
						style="float: left; width: 100%; height: 30%;">
						<p>
							<span id="total"></span>
						</p>
					</div>
		 			<br/>
		 			
		 			
		<s:if test="userInfo.firstName != null">Welcome <s:property value="userInfo.firstName" />&nbsp; 
		 				<s:property value="userInfo.lastName" /> </s:if>
		 			<s:else>
		 			    <%String nofb = System.getProperty("noFB");
		 			      session.setAttribute("noFB", nofb) ;
		 			    %>
		 			     <!-- http://struts.apache.org/2.x/docs/multiple-submit-buttons.html --> 
		 			     <s:if test="#session.noFB != null">
		 			     	<button type="submit" formaction="fbAuthAction" 
		 						value="noFacebookLogin" name="buttonName" style="text-align: right;">Login</button>
		 			     </s:if>
		 			     <s:else>
		 			      <div class="fb-login-button">Login with Facebook</div>
		 					<s:submit action="authAction"  onclick="facebooklogin()"
		 						value="FacebookLogin" name="buttonName" style="text-align: right;"></s:submit>
		 				 </s:else>	
		 			</s:else> 			
		 			
		 			
		 			
		 			
	  <div class="fb-comments" data-href="http://www.mekara.in" data-num-posts="10" data-width="670"></div>
	  <br/>
		<div id="facebooksection"></div>
	<script>(function(d, s, id) {
	  var js, fjs = d.getElementsByTagName(s)[0];
	  if (d.getElementById(id)) return;
	  js = d.createElement(s); js.id = id;
	  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=157461614311935";
	  fjs.parentNode.insertBefore(js, fjs);
	}(document, 'script', 'facebook-jssdk'));
	
	
	</script>
	<div id="fb-root"></div>
	<script>(function(d, s, id) {
	  var js, fjs = d.getElementsByTagName(s)[0];
	  if (d.getElementById(id)) return;
	  js = d.createElement(s); js.id = id;
	  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=157461614311935";
	  fjs.parentNode.insertBefore(js, fjs);
	}(document, 'script', 'facebook-jssdk'));</script>
	<s:file name="userImage" label="User Image" id="userImage"/>
	<a href="#" onclick="publishWallPost(document.getElementById('userImage').value)"> Post to Facebook </a>
	
		</div>
	</section>
	
	</form>
	<section id="footer">
	<div id="pagefooter" >
	<button onclick="goback();">Go back</button>
	 <button onClick="printCanvas(document.getElementById('directionsPanel'));return false;">Print</button>
	</div>
	</section>
	
</body>
</html>